package com.service.api;

import com.service.other.Logger;

public class ApiServerManager {
	public static Thread locationServiceThread = null;
	public static Thread telematicsServiceThread = null;
	public static void runLocationServiceThread() {
		try{
			if (locationServiceThread == null || !locationServiceThread.isAlive()) {
				Logger.println("Baidu Api Geoconv Service start");
				locationServiceThread = new Thread(new BaiduApiLocation(),"Baidu Api Location Service");
				locationServiceThread.start();
			}
		}catch(Exception e){
			Logger.err("百度地址获取失败");
		}
	}
	
	public static void runTelematicsServiceThread() {
		try{
			if (telematicsServiceThread == null || !telematicsServiceThread.isAlive()) {
				Logger.println("Baidu Api Telematics Service start");
				telematicsServiceThread = new Thread(new BaiduApiTelematics(),"Baidu Api Telematics Service");
				telematicsServiceThread.start();
			}
		}catch(Exception e){
			Logger.err("百度补点失败");
		}
	}
}
